#include<stdio.h>
#include "lkqueue.h"

int main()
{
    //实例化一个队列
    LkQueue *q = InitQueue();

    printf("队列是否为空:%d\n",QueueIsEmpty(q));
    printf("元素数量:%d\n",QueueSize(q));
    Datatype  a = 0; //可以的数据
    bool r = GetHead(q,&a);
    if(r)
    {
        printf("获取队头成功:%d\n",a);
    }else 
    {
        printf("获取队头失败!\n");
    }

    printf("===================\n");
    for(int i=1;i<=5;i++)
    {
        EnQueue(q,i);
    }

    printf("队列是否为空:%d\n",QueueIsEmpty(q));
    printf("元素数量:%d\n",QueueSize(q));
    r = GetHead(q,&a);
    if(r)
    {
        printf("获取队头成功:%d\n",a);
    }else 
    {
        printf("获取队头失败!\n");
    }

    printf("===================\n");
    DeQueue(q);
    DeQueue(q);

    printf("元素数量:%d\n",QueueSize(q));
    r = GetHead(q,&a);
    if(r)
    {
        printf("获取队头成功:%d\n",a);  //3
    }else 
    {
        printf("获取队头失败!\n");
    }

    while( !QueueIsEmpty(q))
    {
        GetHead(q,&a);
        printf("value = %d\n",a);
        DeQueue(q);
    }


    //销毁一个队列
    DestoryQueue(q);
    return 0;
}